package com.sunyifeng.ch05;

import java.util.Arrays;
import java.util.List;

import static java.util.stream.Collectors.toList;

/**
 * 5.2.2 流的扁平化
 */
public class MapDemo {
    public static void main(String[] args) {
        List<String> words = Arrays.asList("Hello", "World");
        List<String[]> list = words.stream()
                .map(word -> word.split(""))
                .distinct()
                .collect(toList());
        list.forEach(System.out::println);
         System.out.println("list的大小是：" + list.size());
    }
}
